import sevoes from "@/util/Http";
import Qs from "qs";
export function recommendInquire(data) {
  //推荐查询
  return sevoes({
    method: "get",
    params: {
      _gp: "admin.recommend",
      _mt: "queryRecommendByType",
      ...data,
    },
  });
}

function recommendAdd(data) {
  //新增
  return sevoes({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.recommend",
      _mt: "addRecommend",
      ...data,
    }),
  });
}

function recommendDelete(data) {
  //删除
  return sevoes({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.recommend",
      _mt: "deleteRecommend",
      ...data,
    }),
  });
}

function recommendSPU() {
  //获取SPU树
  return sevoes({
    method: "get",
    params: {
      _gp: "admin.goods",
      _mt: "getSpuBigTree",
    },
  });
}

export default {
  recommendInquire,
  recommendAdd,
  recommendDelete,
  recommendSPU,
};
